<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>轮播的小点点</title>
    <link type="text/css" href="index.css" rel="stylesheet">
</head>
<body>
<div class="area">
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>

<script>
    console.log(document.getElementsByTagName("ul").length);
    document.getElementsByTagName("ul").length;
    document.getElementsByClassName("area")[0].addEventListener("click",function (e) {
        if(e.target.nodeName.toLowerCase() == "li"){
            e.target.style.backgroundColor = "red";
        }
    });
</script>
</body>
</html>